<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html >

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<form id="setUserForm" method="post" style="text-align: center;">
        <div class="addUser first">
            <label>用户名：</label>
            <input name="username" id="username2" readonly=true class="easyui-validatebox" required="true">
        </div>
        <div class="addUser">
            <label>姓名：</label>
            <input name="niceName" id="nicename2" class="easyui-validatebox" required="true">
        </div>
        <div class="addUser">
            <label>密码：</label>
            <input id="password2" name="password" type="password" validType="length[4,32]" class="easyui-validatebox" required="true" value=""/>
        </div>
        <div class="addUser">
            <label>确认密码：</label>
             <input type="password" name="repassword" id="repassword2" required="true" class="easyui-validatebox"  validType="equalTo['#password2']" invalidMessage="两次输入密码不匹配"/>
        </div>
        <div class="addUser" style="margin-left:-100px;">
            <label>性别：</label>
            <input type="radio" checked="checked" name="sex" id="male2" value="男">男
            <input type="radio" name="sex" id="female2" value="女">女
        </div>
        <div class="addUser">
            <label>移动电话：</label>
            <input name="phone" id="phone2">
        </div>
        <div class="addUser">
            <label>邮箱：</label>
            <input name="email" id="email2" class="easyui-validatebox" data-options="validType:'email'" /> 
        </div>
    </form>
    
     <style type="text/css">
     	.addUser label,.addUser span{
    		width:60px;
   			display:inline-block;
   			text-align:right; 
   		} 
    	.first{
    		margin-top:20px;
    	}
    	.addUser{
    		height:30px;
    		line-height:30px;
    	}
    	
    </style> 
    
<script type="text/javascript">
$.extend($.fn.validatebox.defaults.rules, {
    // 必须和某个字段相等
    equalTo: {
        validator: function(value, param) {
            return $(param[0]).val() == value;
        	
        },
        message: '两次密码不匹配'
    }
});
</script>
</body>
</html>